import type { App } from 'vue'

export default {
  install(app: App) {
    const components = import.meta.glob('./**/*.vue')
    for (const [key, importPath] of Object.entries(components)) {
      const level = key.split('/').length
      const name = key.split('/')[level - 1].replace('.vue', '')
      app.component(name, importPath)
    }
  }
}
